package com.xiaoyu.shenyou.shenyouv1.controller;

import com.xiaoyu.shenyou.shenyouv1.common.result.Result;
import com.xiaoyu.shenyou.shenyouv1.entity.RecordEntity;
import com.xiaoyu.shenyou.shenyouv1.services.RecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@Slf4j
@RequestMapping("/api/v1/record")
public class RecordController {

    @Autowired
    private RecordService recordService;


    @GetMapping("/list")
    public Result getRecords() {
        List<RecordEntity> records = recordService.queryRecords(100);
        Result<List<RecordEntity>> success = Result.success(records);
        return success;
    }

}
